class JqpUtil{
    getNodeStyle(style,properties){
        if (properties.current === 'true') {
            style.stroke = "red";
            style.strokeDasharray  = "8 3";
        }else if (properties.active === 'true') {
            style.stroke = "rgb(48, 191, 19)";
        }
    }
    buildGraphContext(graphData){
        return new GraphContext(graphData);
    }
}

class GraphContext{
    nodeMap = {};
    edgeMap = {};
    constructor(graphData) {
        for(let i=0;i<graphData.nodes.length;i++){
            let node = graphData.nodes[i];
            this.nodeMap[node.id] = node;
        }
        for(let i=0;i<graphData.edges.length;i++){
            let edge = graphData.edges[i];
            this.edgeMap[edge.id] = edge;
        }
    }
}

export default new JqpUtil();
